﻿namespace HutongGames.PlayMaker
{
    using System;
    using System.Runtime.CompilerServices;
    using UnityEngine;

    public static class FsmTime
    {
        [CompilerGenerated]
        private static float PlayerPausedTime__BackingField;
        private static bool playerPauseStarted;
        private static bool realtimeStarted;
        private static float startPauseTime;

        public static void EndPlayerPause()
        {
            if (playerPauseStarted)
            {
                PlayerPausedTime += Time.realtimeSinceStartup - startPauseTime;
            }
            playerPauseStarted = false;
        }

        public static void RealtimeBugFix()
        {
            realtimeStarted = true;
        }

        public static void StartPlayerPause()
        {
            startPauseTime = Time.realtimeSinceStartup;
            playerPauseStarted = true;
        }

        public static float PlayerPausedTime
        {
            [CompilerGenerated]
            get
            {
                return PlayerPausedTime__BackingField;
            }
            [CompilerGenerated]
            private set
            {
                PlayerPausedTime__BackingField = value;
            }
        }

        public static float RealtimeSinceStartup
        {
            get
            {
                if (realtimeStarted)
                {
                    return (Time.realtimeSinceStartup - PlayerPausedTime);
                }
                return 0f;
            }
        }
    }
}

